﻿UE.plugins['zidingyibiankuang'] = function(){
    var me = this,
        list = [],img,
        flag = 0;

/*	var dialog = new UE.ui.Dialog({
        //指定弹出层中页面的路径，这里只能支持页面,因为跟addCustomizeDialog.js相同目录，所以无需加路径
        iframeUrl:'btn_add/Btn-Add.html',
        //需要指定当前的编辑器实例
        editor:editor:UE.getEditor('editor'),
        //指定dialog的名字
        name:'按钮添加',
        //dialog的标题
        title:"选择要添加的按钮",

        //指定dialog的外围样式
        cssRules:"width:600px;height:400px;",

        //如果给出了buttons就代表dialog有确定和取消
        buttons:[
            {
                className:'edui-okbutton',
                label:'确定',
                onclick:function () {
					var childDocument=dialog.getDom().getElementsByTagName('iframe')[0].contentDocument;
					var inputs=childDocument.btnAttrs.getElementsByTagName('input');
					var attrs={};
					for(var i=0;i<inputs.length;i++){
						attrs[inputs[i].name]=inputs[i].value;
					}
					var innertext=childDocument.getElementById('innerText').value;
					var btn=createButton(attrs,innertext);
					btn.contentEditable=false;
					console.log(btn.outerHTML);
                	editor.execCommand( 'inserthtml', btn.outerHTML);
                    //dialog.close(true);
                }
            },
            {
                className:'edui-cancelbutton',
                label:'取消',
                onclick:function () {
                    dialog.close(false);
                }
            }
        ]});*/
		
/*    me.commands['zidingyibiankuang'] = {
        execCommand : function( cmdName ) {
			
			console.log(cmd);
			console.log(value);
            var cells, ut;
            cells = getSelectedArr(this);
            ut = getUETable(cells[0]);
			console.log(cells);
            // ut.setBackground(cells, value);
			
			
			alert('it works!!!???');
        },
        queryCommandState : function() {
            return true;
        },
        //notNeedUndo : 1
    };*/
};